 <div class="page-content" >
            
    <div class="panel panel-default">
        <div class="panel-heading">
            题型管理            <a class="btn btn-primary btn-xs" href="<{:U('questype')}>">返回列表</a>
        </div>
        <div class="panel-body">
             <form action="<{:U('Questions/add_questype')}>" method="post" class="form-horizontal">
				<fieldset>
				<input type="hidden" name="id" value="<{$data.questid}>"/>
				<div class="form-group">
                    <label class="col-sm-2 control-label">题型名称</label>
                    <div class="col-sm-7">
                        <input type="text" name="questype" class="form-control" value="<{$data.questype}>">
                    </div>
                    <div class="col-sm-3">
                    </div>
                </div>
				
				
				<div class="form-group">
                    <label class="col-sm-2 control-label">题型分类</label>
                    <div class="col-sm-7">
                       <select class="combox" id="questsort" name="questsort" onchange="javascript:if($(this).val() == '2')$('#choicebox').show();else $('#choicebox').hide();" autocomplete="off">
							<volist name="questype_class['questsort']" id="vo">
							<option  <if condition="$data['questsort'] eq $key">selected="selected"</if> value="<{$key}>"><{$vo}></option>
							</volist>
  							 
						</select>
                    </div>
                    <div class="col-sm-3">
                    </div>
                </div>
				
				
				
				
				<div class="form-group" id="choicebox"  <if condition="$data['questsort'] eq 1">style="display: none;"</if>>
                    <label class="col-sm-2 control-label">选项分类</label>
                    <div class="col-sm-7">
                       <select class="combox" name="questchoice" id="questchoice" autocomplete="off">
							<volist name="questype_class['questchoice']" id="vo">
							<option  <if condition="$data['questchoice'] eq $key">selected="selected"</if> value="<{$key}>"><{$vo}></option>
							</volist>
						</select>
							<span class="help-block">不定项选按照选对答案数给分，判断题将自动生成判断选项。</span>
                    </div>
                    
                </div>
				
				 
				 
				 
				 
				<div class="control-group">
				  	<div class="col-sm-offset-2 col-sm-7"><button class="btn btn-primary" type="submit" autocomplete="off">提交</button></div>
				</div>
				</fieldset>
			</form>
        </div>
    </div>
   

        </div>
 <script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            questype: {
                message: '题型名称',
                validators: {
                    notEmpty: {
                        message: '题型名称不能为空'
                    },
                }
            },
			 questsort: {
                message: '题型分类',
                validators: {
                    notEmpty: {
                        message: '请选择题型分类'
                    },  
                }
            },

        }
    });
	
 
});
 </script>

   